<include file="__THEME__/public_header" />
<div class="content">
    <div class="wrap">
        <div class="con_side">
            <ul class="nav">
                <li  class="cursor"><a href="{:U('admin/Resource/admin_show_resource')}">资源管理</a></li>
                <li><a href="{:U('admin/Resource/teacher')}">教师管理</a></li>
            </ul>
        </div>
        <div class="con_main">
            <div class="con_tit">
                <ul class="con_link">
                    <li class="on"><a href="javascript:;">筛选</a></li>
                    <li><a href="{:u('admin/Resource/show_upload_page')}">上传资源</a></li>
                </ul>
            </div>
            <div class="con_box">
                <ul class="slect_list2">
                    <li>
                        <div class="txt">选择资源来源：</div>
                        <div class="inp">
                            <select id="type">
                                <option value="0">----请选择----</option>
                                <option value="1">培训资源</option>
                                <option value="2">学习资源</option>
                            </select>
                        </div>
                    </li>
                    <li>
                        <div class="txt">选择资源类型：</div>
                        <div class="inp">
                            <select id="category">
                                <option value="0">----请选择----</option>
                                <option value="1">文档资源</option>
                                <option value="2">视频资源</option>
                            </select>
                        </div>
                    </li>
                </ul>
                <div class="action_link tc small">
                    <a class="save" href="javascript:select_filter();">确定</a>
                </div>
            </div>
            <div class="con_box">
              <ul class="learningList" style="float:left;width:960px;">
                     <if condition="$data['data']">
                        <volist name="data['data']" id="listData">
                          <li>
                              <div class="pic"><a href="{:U('admin/Resource/view',array('id'=>$listData['id']))}" target="_black"><img src="{$listData.img_url}"></a></div>
                                <div class="txt"><span>{$listData['ctime']|date='Y/m/d',###}</span><a href="{:U('admin/Resource/view',array('id'=>$listData['id']))}">{$listData.resource_name}</a></div>
                                <div class="stu"><span></span>{$listData.learn_sum}&nbsp;人在学&nbsp;&nbsp;
                                <a href="{:U('admin/Resource/show_upload_page',array('id'=>$listData['id']))}">修改</a>  <a href="javascript:delResource({$listData['id']});">删除</a></div>
                            </li>
                        </volist>
                    <else/>
                    暂无资源
                    </if>
                </ul>
                {$data.html}
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="uid">
<script>
  function delResource(id){
    if(confirm("您确定要删除这个资源？")){
      $.ajax({
        type: "POST",
        url:"{:U('admin/Resource/delete_Resource')}",
        data:"id="+id,
        dataType:"text",
        success:function(data){
          if(isNaN(data)){
            alert(data);
          }else{  
            window.location.href=window.location.href;
          }
        }
      }); 
    }
  }
    function select_filter(){
      var type=$("#type").val();
      var category=$("#category").val();
      window.location.href = "{:U('admin/Resource/admin_show_resource')}"+"&category="+category+"&type="+type; 
    }
</script>
<include file="__THEME__/public_footer" />